﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Caliburn.Micro;
using System.Diagnostics;

namespace DomusDotNet.Sbm.Client.WP7.Services
{
    public class DebugLog: ILog
    {
        public static void Hook() {
            Caliburn.Micro.LogManager.GetLog = x => new DebugLog(x.Name);
        }

        string prefix;
        public DebugLog(string prefix) {
            this.prefix = prefix;
        }
        public void Error(Exception exception)
        {
            Debug.WriteLine("[" + prefix + "] " + exception.ToString());
        }

        public void Info(string format, params object[] args)
        {
            Debug.WriteLine("[" + prefix + "] " + format, args);
        }

        public void Warn(string format, params object[] args)
        {
            Debug.WriteLine("[" + prefix + "] " + format, args);
        }
    }
}
